<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ page import="net.sapfree.core.db.RecordSet"%>
<%@ page import="net.sapfree.core.db.Record"%>
<%@ page import="net.sapfree.common.Constants"%>
<%@ page import="net.sapfree.core.util.CutHtml"%>
<%@ page import="net.sapfree.article.ArticleHandler"%>

<%@page import="net.sapfree.core.web.RequestKit"%>
<%@ page import="net.sapfree.core.db.PagingInfo"%>




<%@ taglib uri="/WEB-INF/sapfree-info.tld" prefix="sap" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String personuuid = request.getAttribute("personuuid")==null?"":request.getAttribute("personuuid").toString();

PagingInfo pagingInfo = (PagingInfo) request.getAttribute("pagingInfo");

int pageno =1;
if(pagingInfo!=null){
	pageno = pagingInfo.getCurrentPageNo();
}

RecordSet allArticle = (RecordSet) request.getAttribute("allArticle");
if (null == allArticle)
{
    allArticle = new RecordSet();
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="login,regist first">
<meta http-equiv="description" content="This is login page">

<title>我的飞客</title>
<link href="<%=path%>/include/styleBase/css/ostable.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/leftPage.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/styleBase.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/messageType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/exchangeType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/userType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/headfoot.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/fontStyle.css" rel="stylesheet"></link>


<script type="text/javascript" src="<%=path%>/include/KindEditor/kindeditor.js"></script>
<script type="text/javascript" src="<%=path%>/include/js/jquery.js"></script>

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<script>


function saveBlog(){
	content = KE.util.getPureData("editorContent")
	//htmlcontent = KE.html("editorContent");
	$("#CONTENT").val(content);
	document.frm.action="<%=path%>/article/articlelist?method=saveNewBlog";
	document.frm.submit();
}

var ii="tttttttttt";
function newBlog(){
	window.open('<%=path%>/article/articlelist?method=newBlog',"新建博客")
}


function deleteBlog(bloguuid){
	document.frm.action="<%=path%>/article/articlelist?method=deleteBlog&bloguuid="+bloguuid;
	document.frm.submit();
}

function blogDetail(bloguuid){
	document.frm.action="<%=path%>/article/articlelist?method=blogDetail&bloguuid="+bloguuid;
	document.frm.submit();
}

function editBlog(bloguuid){
	window.open("<%=path%>/article/articlelist?method=editBlog&bloguuid="+bloguuid,"修改文章","");
}

$(document).ready(function(){
 
});
</script>

</head>
<body>
<form name="frm" method="post">

  <input style="display:none" class="inputTxt" type="text" id="ARTICLE_AI_TITLE" name="ARTICLE_AI_TITLE" value=""/>
  <input style="display:none" class="inputTxt" type="text" id="ARTICLE_AI_PUBLISHTIME" name="ARTICLE_AI_PUBLISHTIME" value=""/>
  
  <input style="display:none" type="text" id="CONTENT" name="CONTENT" value=""/>
  <input style="display:none" type="text" id="HTMLCONTENT" name="HTMLCONTENT" value=""/>
  

	<!--#include file="top.htm"-->
<%//@include file="../../include/jsp/top.jsp"%>
<jsp:include   page="../../include/jsp/top.jsp"    flush="true">   
	<jsp:param    name="funid"    value="3"    />   
</jsp:include>


<table border="0" cellpadding="0" cellspacing="0" width="1000" style="margin:0px auto;">
	<tr>
    	<!--td width="20"></td-->
    	<td width="290" valign="top">
        <!--左侧功能导航区-->
        <%@include file="../../include/jsp/leftallarticle.jsp"%>
        
        <!--
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
        	<tr><td height="5px" colspan="2"><hr size="1" width="160" color="#999999" align="left"></td></tr>
            <tr>
       		  <td height="40" width="5" valign="middle" align="center"></td>
                <td class="blueBold14">热门圈子<br>
            </tr>
      	</table>
        
        <div id="navDiv" style="width:100%;">
        <sap:QuanList count="5">
        	<sap:Quan>
	            <div class="titleDiv">&nbsp;&nbsp;<sap:write property="QUAN_NAME" /></DIV>
            </sap:Quan>
        </sap:QuanList>
      	</div>
        -->
        
        <table width="100%" cellpadding="0" cellspacing="0" border="0" style="text-align:left;font-size:8px;">
        	<tr>
           		<td height="30" width="5" valign="middle" align="center"></td>
                <td class="blueBold14">威望用户<br>
            </tr>
        </table>
        
        <table width="100%" cellpadding="0" cellspacing="1" border="0" style="text-align:left;font-size:8px;" bgcolor="#cccccc">
        <tr>
        	<td>
            <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
            <tr>
            	<td>
                <sap:PersonList count="5">
                    <sap:Person>
                        <tr>
                            <td width="10">&nbsp;</td>
                            <td height="65" width="65" align="center">
                            <a href="<%=path%>/person/personarea?personuuid=<sap:write property='PI_UUID' />">
                            <img width="50" height="50" border="2" style="border-color:#cccccc" src="<%=path%>/servlet/FileUploadManagerServlet?method=showImage&imgPath=<sap:write property='PI_YSZHAOPIAN' />&defPath=nobody.gif" />
                            </a>
                            </td>
                            <td class="blackNormal14"><a href="<%=path%>/person/personarea?personuuid=<sap:write property='PI_UUID' />"><span class="blackNormal14"><sap:write property="PI_FIRSTNAME" /><sap:write property="PI_LASTNAME" />（<sap:write property="PI_WORKSTATUS"/>）</span></a></td>
                        </tr>
                    </sap:Person>
                </sap:PersonList>
                </td>
            </tr>
            </table>
            </td>
        </tr>
        </table>
        <!--左侧功能导航区-->
        </td>
        <td width="10"></td>
      	<td width="690" valign="top">
        <!--中间主信息展示区-->
        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" width="98%" align="center">
        	<tr>
           	  <td colspan="2" class="blueBold14" height="30">
			  	<img src="../images/report_edit.png" border="0">&nbsp;最新文章：
				&nbsp;&nbsp;
				<a href="#2011" onClick="newBlog();"><span class="lightBlueNormal12">发布博文</span></a>
			  </td>
            </tr>
        	<tr><td height="5"> <hr width="100%" size="1" color="#999999"></td></tr>
        
            
            
            <%for(int i=0;i<allArticle.size();i++){
           		 Record record = allArticle.get(i);
            %>
	            <tr >
		        	<td valign="top" >
		            <table border="0" cellpadding="0" cellspacing="0" width="99%">
		            	<tr>
		                	<td class="lightBlueBold14" colspan="2" height="30">
		                		<span style="cursor:pointer;" onClick="blogDetail('<%=record.getString("AI_UUID","")%>')"><%=record.getString("AI_TITLE","")%></span>
		                		&nbsp;&nbsp;
								<span class="greyNormal12"><%=record.getString("AI_PUBLISHTIME","")%></span>
								&nbsp;
								<%if(personuuid.equals(record.getString("AI_PERSONUUID",""))){
								%>
	                                <a href="#2011" onClick="editBlog('<%=record.getString("AI_UUID","")%>');"><span class="lightBlueNormal12">[编辑]</span></a>
								<a href="#2011" onClick="deleteBlog('<%=record.getString("AI_UUID","")%>');"><span class="lightBlueNormal12">[删除]</span></a>
								<%} %>
							</td>
		                </tr>
		            	<tr>
		                	
		                	<td class="blackNormal12" height="25" colspan="2">
                            标签：
                            <%
                                 String articleId=(String)record.getString("AI_UUID","");
                                 RecordSet tagRst = ArticleHandler.getTagInfoByArtId(articleId);
                                 for(int j=0;j<tagRst.size();j++){
                                    Record tagrecord = tagRst.get(j);
                                 %>
                                    <a href="#2011" onClick="seaBlogByTag('<%=tagrecord.getString("AT_TAGUUID","")%>');"><%=tagrecord.getString("AT_TAGNAME","")%></a>
                                <%}
                            %>
                            </td>
		                	
		                </tr>
		                <tr>
		                	<td class="blackNormal12" height="25" colspan="2">
		                	<%
	                        String htmlContent=record.getString("AC_HTML_CONTENT","");
	                        %>
		                	<%=CutHtml.subStringHTML(htmlContent,Constants.ARTICLE_CUT_LENGTH, "...")%>
							</td>
		                </tr>
		                <tr>
		                	<td class="greyNormal12" align="left" height="30">阅读（<%=record.getString("AI_READCOUNT","")%>）&nbsp;&nbsp;|&nbsp;&nbsp;评论（<%=record.getString("AI_DISCUSSCOUNT","")%>）&nbsp;&nbsp;|&nbsp;&nbsp;收藏（<%=record.getString("AI_UPCOUNT","")%>）</td>
		                	<td class="orangeBold12" align="right" style="cursor:pointer;" onClick="blogDetail('<%=record.getString("AI_UUID","")%>')">查看全文>></td>
		                </tr>
		            </table>
		            </td>
		        </tr>
		        <tr><td height="10"> <hr width="100%" size="1" color="#CCCCCC"></td></tr>
            <%}%>
            
        
        
        
        	
        
        
      
        
        </table>
        </form>
       
      <!--中间主信息展示区-->     
      
      <div class="">
			<jsp:include flush="true" page="/include/jsp/paging.jsp"></jsp:include>
		</div>
      </td>
      
	</tr>
</table>


  
<br>
<table border="0" cellpadding="0" cellspacing="0" width="1000" style="margin:0px auto;">
	<tr><td height="10"></td></tr>
	<tr><td><hr color="#999999" size="1" width="100%"></td></tr>
	<tr>
    	<td align="center" height="25">
        （C） 2011-2016 Sapfree.com
        </td>
    </tr>
    <tr>
    	<td align="center" height="25">
        联系我们&nbsp;&nbsp;隐私声明&nbsp;&nbsp;使用条款&nbsp;&nbsp;版权商标&nbsp;&nbsp;网站地图
        </td>
    </tr>
</table>
<br><br>
   



</body>
</html>